/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.cggveritas.crewintranet.jms.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Alassane
 */
@Entity
@Table(name = "cv_avertissement")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CvAvertissement.findAll", query = "SELECT c FROM CvAvertissement c"),
    @NamedQuery(name = "CvAvertissement.findByIdavertissement", query = "SELECT c FROM CvAvertissement c WHERE c.idavertissement = :idavertissement"),
    @NamedQuery(name = "CvAvertissement.findByDate", query = "SELECT c FROM CvAvertissement c WHERE c.date = :date"),
    @NamedQuery(name = "CvAvertissement.findByTypeavertissement", query = "SELECT c FROM CvAvertissement c WHERE c.typeavertissement = :typeavertissement"),
    @NamedQuery(name = "CvAvertissement.findByDonneepar", query = "SELECT c FROM CvAvertissement c WHERE c.donneepar = :donneepar")})
public class CvAvertissement implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idavertissement")
    private Integer idavertissement;
    @Basic(optional = false)
    @Column(name = "date")
    @Temporal(TemporalType.DATE)
    private Date date;
    @Basic(optional = false)
    @Column(name = "typeavertissement")
    private String typeavertissement;
    @Basic(optional = false)
    @Column(name = "donneepar")
    private String donneepar;
    @Lob
    @Column(name = "commentaire")
    private String commentaire;
    @Lob
    @Column(name = "scanavertissement")
    private String scanavertissement;
    @JoinColumn(name = "cv_travailleur_id", referencedColumnName = "id")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private CvTravailleur cvTravailleurId;

    public CvAvertissement() {
    }

    public CvAvertissement(Integer idavertissement) {
        this.idavertissement = idavertissement;
    }

    public CvAvertissement(Integer idavertissement, Date date, String typeavertissement, String donneepar) {
        this.idavertissement = idavertissement;
        this.date = date;
        this.typeavertissement = typeavertissement;
        this.donneepar = donneepar;
    }

    public Integer getIdavertissement() {
        return idavertissement;
    }

    public void setIdavertissement(Integer idavertissement) {
        this.idavertissement = idavertissement;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public String getTypeavertissement() {
        return typeavertissement;
    }

    public void setTypeavertissement(String typeavertissement) {
        this.typeavertissement = typeavertissement;
    }

    public String getDonneepar() {
        return donneepar;
    }

    public void setDonneepar(String donneepar) {
        this.donneepar = donneepar;
    }

    public String getCommentaire() {
        return commentaire;
    }

    public void setCommentaire(String commentaire) {
        this.commentaire = commentaire;
    }

    public String getScanavertissement() {
        return scanavertissement;
    }

    public void setScanavertissement(String scanavertissement) {
        this.scanavertissement = scanavertissement;
    }

    public CvTravailleur getCvTravailleurId() {
        return cvTravailleurId;
    }

    public void setCvTravailleurId(CvTravailleur cvTravailleurId) {
        this.cvTravailleurId = cvTravailleurId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idavertissement != null ? idavertissement.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CvAvertissement)) {
            return false;
        }
        CvAvertissement other = (CvAvertissement) object;
        if ((this.idavertissement == null && other.idavertissement != null) || (this.idavertissement != null && !this.idavertissement.equals(other.idavertissement))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "fr.cggveritas.crewintranet.jms.entities.CvAvertissement[ idavertissement=" + idavertissement + " ]";
    }
    
}
